// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

.ChannelSettingsModal {
    &__accessRulesTab {
        display: flex;
        max-height: 100%;
        flex: 1;
        flex-direction: column;
        padding-bottom: 60px;
        overflow-y: auto;
    }

    &__systemPolicies {
        margin-bottom: 20px;
    }

    &__accessRulesHeader {
        display: flex;
        flex-direction: column;
        margin-bottom: 16px;
        gap: 8px;
    }

    &__accessRulesEditor {
        .table-editor__cell {
            button {
                color: var(--center-channel-color) !important;
                &:hover{
                    background-color: rgba(var(--center-channel-color-rgb), 0.08) !important;
                }
            }
        }

        .editor__help-text {
            width: 75%;
            color: rgba(var(--center-channel-color-rgb), 0.56) !important;
        }
    }

    &__accessRulesTitle {
        margin: 0;
        color: var(--center-channel-color);
        font-family: Metropolis, sans-serif;
        font-size: 20px;
        font-weight: 600;
        line-height: 28px;
    }

    &__accessRulesSubtitle {
        margin: 0;
        color: rgba(var(--center-channel-color-rgb), 0.72);
        font-family: 'Open Sans', sans-serif;
        font-size: 12px;
        font-weight: 400;
        line-height: 20px;
    }

    &__divider {
        border: none;
        border-top: 1px solid rgba(var(--center-channel-color-rgb), 0.16);
        margin: 24px 0;
    }

    &__autoSyncCheckboxContainer {
        display: flex;
        align-items: center;
        margin-bottom: 8px;
        gap: 8px;
    }

    &__autoSyncLabel {
        display: flex;
        align-items: center;
        margin: 0;
        cursor: pointer;
        user-select: none;
    }

    &__autoSyncCheckbox {

        // Use standard checkbox styling from base_setting_item.scss
        display: grid;
        width: 1.6rem;
        height: 1.6rem;
        flex-shrink: 0;
        border: 1px solid rgba(var(--center-channel-color-rgb), 0.24);
        border-radius: 3px;
        margin: 0;
        -webkit-appearance: none;
        appearance: none;
        background-color: transparent;
        color: rgba(var(--center-channel-color-rgb), 0.24);
        cursor: pointer;
        font: inherit;
        place-content: center;
        -webkit-transition: background-color 200ms ease-out;
        -moz-transition: background-color 200ms ease-out;
        -o-transition: background-color 200ms ease-out;
        transition: background-color 200ms ease-out;

        &::before {
            width: 10px;
            height: 10px;
            background: var(--button-color);
            clip-path: polygon(0% 57%, 32% 88%, 100%  20%, 88% 8%, 32% 64%, 12% 45%);
            content: '';
            transform: scale(0);
            transform-origin: center center;
            transition: 200ms transform ease-in-out;
        }

        &:checked::before {
            transform: scale(1);
        }

        &:checked {
            border-color: var(--button-bg);
            background: var(--button-bg);
        }

        &:disabled {
            cursor: not-allowed;
            opacity: 0.5;
        }
    }

    &__autoSyncText {
        color: var(--center-channel-color);
        font-family: 'Open Sans', sans-serif;
        font-size: 14px;
        font-weight: 400;
        line-height: 20px;

        &.disabled {
            color: rgba(var(--center-channel-color-rgb), 0.5);
            cursor: not-allowed;
        }
    }

    &__autoSyncDescription {
        margin: 0 0 0 24px;
        color: rgba(var(--center-channel-color-rgb), 0.56);
        font-family: 'Open Sans', sans-serif;
        font-size: 12px;
        font-weight: 400;
        line-height: 16px;
    }
}
